<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
</script>
</head>
<body>


<img id="img1" src="" />
<script>
var img = document.getElementById("img1");
img.setAttribute("src","http:// www.w3.org/");		// HTML属性
img.src = "http:// www.w3.org/";					// JavaScript属性
</script>


</body>
</html>
